$(function () {
    $('#client_fail_datagrid').datagrid({
        fit:true,
        url:'/clientFail/selectAllFail.do',
        pagination:true,
        fitColumns:true,
        toolbar:"#client_fail_toolbar",
        singleSelect:true,
        rownumbers:true,
        columns:[[
            {field:'id',title:'编号',width:100,hidden:true},
            {field:'inputTime',title:'录入时间',width:30},
            {field:'takeUser',title:'负责人',width:30,formatter:function (value, row, index) {
                return row.takeUser.username;
            }},
            {field:'name',title:'客户名称',width:30},
            {field:'reason',title:'开发失败原因',width:100}
        ]]
    });
});


function query() {
    var name = $("#name").textbox('getValue');
    var takeUser = $("#takeUser").combobox('getValue');
    var beginTime = $("#beginTime").textbox('getValue');
    var endTime = $("#endTime").textbox('getValue');

    $("#client_fail_datagrid").datagrid('load',{
        name:name,
        takeUser_id:takeUser,
        beginTime:beginTime,
        endTime:endTime
    });
}